package cn.iocoder.yudao.module.wrdk.dal.mysql.licencefile;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.wrdk.dal.dataobject.licencefile.wrdklicencefileDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.wrdk.controller.admin.licencefile.vo.*;

/**
 * 地块许可证文件 Mapper
 *
 * @author admin
 */
@Mapper
public interface wrdklicencefileMapper extends BaseMapperX<wrdklicencefileDO> {

    default PageResult<wrdklicencefileDO> selectPage(wrdklicencefilePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<wrdklicencefileDO>()
                .eqIfPresent(wrdklicencefileDO::getLandid, reqVO.getLandid())
                .eqIfPresent(wrdklicencefileDO::getPath, reqVO.getPath())
                .likeIfPresent(wrdklicencefileDO::getFilename, reqVO.getFilename())
                .eqIfPresent(wrdklicencefileDO::getOwner, reqVO.getOwner())
                .eqIfPresent(wrdklicencefileDO::getSn, reqVO.getSn())
                .eqIfPresent(wrdklicencefileDO::getLicenceid, reqVO.getLicenceid())
                .betweenIfPresent(wrdklicencefileDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(wrdklicencefileDO::getId));
    }

    default List<wrdklicencefileDO> selectList(wrdklicencefileExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<wrdklicencefileDO>()
                .eqIfPresent(wrdklicencefileDO::getLandid, reqVO.getLandid())
                .eqIfPresent(wrdklicencefileDO::getPath, reqVO.getPath())
                .likeIfPresent(wrdklicencefileDO::getFilename, reqVO.getFilename())
                .eqIfPresent(wrdklicencefileDO::getOwner, reqVO.getOwner())
                .eqIfPresent(wrdklicencefileDO::getSn, reqVO.getSn())
                .eqIfPresent(wrdklicencefileDO::getLicenceid, reqVO.getLicenceid())
                .betweenIfPresent(wrdklicencefileDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(wrdklicencefileDO::getId));
    }

}
